import request from '@/utils/request'
import processRichText from "@/utils/processRichText"
import {
	ref,
} from 'vue'

export default () => {
	const groupactivity = ref({
		ID: null,
		title: "",
		post: "",
		Groupcourse: {
			intensity: 0,
			color: "",
			course_type: {
				name: ""
			}
		},
		before_day: 0,
		introduce: "",
		price: 0,
		start_time: "",
		end_time: "",
		require_number: 0,
		current_number: 0,
	})

	const payAmount = ref(0)

	const showGroupactivity = async () => {
		let { data, payPrice } = await request.get(`mini/groupactivity/one`)
		data.introduce = processRichText(data.introduce)
		groupactivity.value = data
		payAmount.value = payPrice
	}

	return {
		showGroupactivity,
		groupactivity,
		payAmount

	}
}